<?
include("../../MerchandiseBay/conn.php");


$category=$_REQUEST['category'];


$categorySQL="select * from category where category='$category'";
$categoryQuery=mysql_query($categorySQL,$conn);


?>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>New Page 1</title>
<style type="text/css">
<!--
body {
	background-color: #330000;
}
.style1 {color: #000066}
.style5 {
	color: #0000FF;
	font-weight: bold;
}
.style9 {
	color: #330000;
	font-weight: bold;
}
-->
</style></head>
<body>
<?
if(mysql_num_rows($categoryQuery)>0) 
{ 
$row=mysql_fetch_assoc($categoryQuery);
?>

<div align="left">
  <table border="1" width="462" style="border-collapse: collapse" bordercolor="#333333">
    <tr><td>
      <table width="102%" border="0" bgcolor="#CCCCCC" id="table1">
        <tr>
          <td background="../mc/images/background/m3.jpg"><font face="Verdana" size="4" color="#FF0000">ERROR!</font></td>
	      </tr>
        <tr>
          <td><font size="2" face="Verdana">Your choice already in the system record</font></td>
	      </tr>
        <tr>
          <td><font face="Verdana" size="2">&nbsp;Category : <span class="style5"><?echo $row['category']?></span></font></td>
	      </tr>
        <tr>
          <td align="center">
            <input type="button" value="&lt;&lt; Back" name="B4" onClick="history.back();"></td>
	      </tr>
    </table></td></tr>
  </table>
</div>
<?}
else {

$categoryInsertSQL="insert into category(category)values('$category')";
$categoryInsertQuery=mysql_query($categoryInsertSQL,$conn);

//$merchandiseInsertSQL="insert into merchandise(category)values('$category')";
//$merchandiseInsertQuery=mysql_query($merchandiseInsertSQL,$conn);
?>

<div align="left">
  <table border="1" width="462" style="border-collapse: collapse" bordercolor="#333333">
    <tr><td>
      <table width="100%" border="0" bgcolor="#CCCCCC" id="table1">
        <tr>
          <td background="../mc/images/background/blueBG.gif"><span class="style1"><font size="4" face="Verdana">Add Category Successfull Recorded </font></span></td>
	      </tr>
        <tr>
          <td><font size="2" face="Verdana">&nbsp;Category : 
              <span class="style9"><?=$category?>
              </span></font></td>
	      </tr>
        <tr>
          <td>&nbsp;</td>
	      </tr>
        <tr>
          <td>&nbsp;</td>
	      </tr>
        <tr>
          <td>&nbsp;</td>
	      </tr>
        <tr>
          <td>&nbsp;</td>
	      </tr>
        <tr>
          <td>&nbsp;</td>
	      </tr>
        <tr>
          <td>
            <p align="center"><font size="2" face="Verdana"> <a href="registerProduct.html" target="_self">Register Product</a>| <a href="categoryForm.php">Add Category</a> |<a href="listCategory.php">List Category</a></font></td>
	      </tr>
    </table></td></tr>
  </table>
</div>
<?}?>
</body>

</html>